using NL.SpriteAnimation;

using UnityEngine;

namespace NL.Advanced
{
    public partial class BB
    {
        private SpriteMoving _Moving;
        private SpriteTargeting _Targeting;
        private SpriteLinking _Linking;

        protected virtual void _ResetSpeed()
        {
            if (_BBRuntime != null && _BBRuntime.ShotSpeed > 0)
            {
                if (_Moving != null)
                    _Moving.Speed = Vector3.forward * _BBRuntime.ShotSpeed;

                if (_Targeting != null)
                    _Targeting.MoveSpeed = _BBRuntime.ShotSpeed;
            }
        }

        protected virtual void _ResetLife()
        {
            if (_BBRuntime != null && _BBRuntime.ShotDuration > 0)
            {
                if (_Linking != null)
                    _Linking.Life = _BBRuntime.ShotDuration;
            }
        }
    }
}

